package com.songhq.zonghe.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.songhq.zonghe.service.WorkService;

@Controller
@RequestMapping("/work")
public class WorkController {
	
	
	@Autowired
	private WorkService workService;
	
	@RequestMapping("/do")
	@ResponseBody
	public String addWork(@RequestParam("name") String name ) {
		
		try {
			Thread.sleep(3000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		//执行任务
		workService.doString(name);
		return "success";
	}
}
